<template>
	<div class="fields-bottom-input" v-if="fieldsObj.type" :style="fieldsObj.settings?.style">
		<p v-if="!fieldsObj.settings.value" class="input-tips" :class="`input-${fieldsObj.type}`">
			请输入内容
		</p>
		<template v-else >
      <pre :class="`input-${fieldsObj.type}`"><p class="input-content" :class="`input-${fieldsObj.type}`" v-html="fieldsObj.settings.value"></p></pre>
		</template>
	</div>
</template>

<script>
export default {
  name: 'CCommon',
  props: {
    fields: {
      default: () => {
        return {}
      },
    },
  },
  watch: {
    'fields': {
      handler (val) {
        this.fieldsObj = val
      },
      deep: true,
      immediate: true
    }
  },
  data () {
    return {
      fieldsObj: {}
    }
  },
  mounted () {
    this.fieldsObj = this.fields
  }
}
</script>

<style lang="less" scoped>
.input-tips {
  color: #CBCFD6;
  text-overflow: -o-ellipsis-lastline;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  line-clamp: 1;
  -webkit-box-orient: vertical;
}

.input-textArea {
  -webkit-line-clamp: initial !important;
  line-clamp: inherit !important;
}
.input-staticText  {
  width: 100%;
}
</style>
